<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="com.manage.servicecenter.ServiceCenterMessageHandleVo"%>
<%@ page import="com.manage.dictionary.DictionaryAction"%>
<%@ page import="com.manage.area.AreaVo"%>
<%@ page import="java.util.List"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String rMsg = (String)request.getAttribute("rMsg");
if (rMsg==null) {
	rMsg="";
}
List<AreaVo> list = (List)request.getAttribute("squList");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<link href="<%=path%>/images/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="<%=path%>/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
	//提交
	$(function(){
		$('#submitbtn').click(function(){
			//! 校验
			if ($('#qqbz_type').val()=='') {
				alert('请选择求助类别！');
				return;
			}
			if ($('input:radio[name=areaChk]:checked').val()=='') {
				alert('请选择所辖中队！');
				return;
			} else {
				$('#squadron').val($('input:radio[name=areaChk]:checked').val());
			}
			if ($('#qqbz_zt').val()=='') {
				alert('请填写求助主题！');
				return;
			}
			if ($('#qqbz_nr').val()=='') {
				alert('请填写求助内容！');
				return;
			}
			$('#qqbzform')[0].submit();
		});
		//重置
		$('#resetbtn').click(function(){
			$('#qqbzform')[0].reset();
		});
		var rMsg = "<%=rMsg%>";
		if (""!=rMsg) {
			alert(rMsg);
			if (rMsg=="创建求助信息成功") {
				$('#qqbzform')[0].reset();
			}
		}
	});
	
</script>
</head>

<body class="bg_003">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="201" height="30" align="center" background="<%=path%>/images/016.jpg"><table width="75%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="25"><img src="<%=path%>/images/1.png" width="16" height="16"></td>
        <td><strong>求助信息填写</strong></td>
      </tr>
    </table></td>
    <td align="right" background="<%=path%>/images/017.jpg" class="zi_006">服务中心</td>
    <td width="39"><img src="<%=path%>/images/018.jpg" width="39" height="30"></td>
  </tr>
</table>
<form action="<%=path%>/servicecenter/addPending.action" name = "qqbzform" id = "qqbzform">
<input type="hidden" name="serviceCenterMessageVo.squadron" id="squadron"/>
<input type="hidden" name="serviceCenterMessageVo.status" value="<%=ServiceCenterMessageHandleVo.STATUS_PENDING%>"/>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="1" bgcolor="#e1e1e2"></td>
        <td height="298" align="center"><table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#e1e1e1">
          <tr>
            <td width="12%" height="31" align="right" bgcolor="#f5f5f5">求助类别：</td>
            <td width="20%" height="31" align="left" bgcolor="#f5f5f5" colspan="3">
            	<select id="qqbz_type" name="serviceCenterMessageVo.messagetype">
	              <option value="">------请选择-----</option>
	              <%
	              	for (int i=0; i<DictionaryAction.DIC_PROGRAM_TYPE.size(); i++) {
	              		String lb = DictionaryAction.DIC_PROGRAM_TYPE.get(i);
	              %>
	              	<option value="<%=lb%>"><%=lb%></option>
	              <%
	              	}
	              %>
	            </select>
            </td>
          </tr>
          <tr>
            <td width="10%" height="31" align="right" bgcolor="#f5f5f5">管辖区县：</td>
            <td width="22%" height="31" align="left" bgcolor="#f5f5f5" colspan="3">
				<table>
					<%
			        for(int i=0;i<list.size();i++){	
			        %>
			   		<tr>
						<td><input type="radio" name="areaChk" value="<%=list.get(i).getMessager_id() %>"/><label><%=list.get(i).getName() %></label></td>
					<% 	
						i++;
						if(i<list.size()){ 
					%>
						<td><input type="radio" name="areaChk" value="<%=list.get(i).getMessager_id() %>"/><label><%=list.get(i).getName() %></label></td>
					<% 	} %>
					<% 	i++;
						if(i<list.size()){ 
					%>
						<td><input type="radio" name="areaChk" value="<%=list.get(i).getMessager_id() %>"/><label><%=list.get(i).getName() %></label></td>
					<% 	} %>
					<% 
						i++;
						if(i<list.size()){ 
					%>
						<td><input type="radio" name="areaChk" value="<%=list.get(i).getMessager_id() %>"/><label><%=list.get(i).getName() %></label></td>
					<% 	} %>
					<% 	i++;
						if(i<list.size()){ 
					%>
						<td><input type="radio" name="areaChk" value="<%=list.get(i).getMessager_id() %>"/><label><%=list.get(i).getName() %></label></td>
					<% 	} %>
					</tr>
					<%} %>
				</table>
            </td>
          </tr>
          <tr>
            <td width="10%" height="31" align="right" bgcolor="#f5f5f5">主题：</td>
            <td width="22%" height="31" align="left" bgcolor="#f5f5f5" colspan="3">
            	<input type="text" id="qqbz_zt" size="130" value="test" name="serviceCenterMessageVo.theme">
            </td>
          </tr>
          <tr>
            <td width="10%" height="31" align="right" bgcolor="#f5f5f5">内容：</td>
            <td width="22%" height="31" align="left" bgcolor="#f5f5f5" colspan="3">
            	<textarea id="qqbz_nr" rows="10" cols="100" name="serviceCenterMessageVo.content">asdf</textarea>
            </td>
          </tr>
        </table>
          <table width="95%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="50" align="center">
              	<input type="button" id="submitbtn" value=" 提 交 ">
              	<input type="button" id="resetbtn" value=" 重 填 ">
              </td>
            </tr>
          </table></td>
        <td width="1" bgcolor="#e1e1e2"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="5" height="5"><img src="images/019.jpg" width="5" height="5"></td>
        <td width="100%" height="5" class="bg_002"></td>
        <td width="5" height="5"><img src="images/020.jpg" width="5" height="5"></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="603" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="26">&nbsp;</td>
  </tr>
</table>
</form>

</body>

</html>